'use strict';

import React from 'react';
import ReactDOM from 'react-dom';
import imgs from '../image/123.png';
import "./search.less";
import '../../common';


class Search extends React.Component{

    constructor(){
        super(...arguments);
        this.state = {
            Text : null
        };
    }

    loadComponent(){
        import("./text").then( (Text)=> {
            this.setState({
                Text: Text.default
            })
        });
    }

    render(){
        const {Text} = this.state;
        return <div className="search-text">
            {
                Text ? <Text/> : null
            }
            Search Text
            <img src= {imgs} onClick = {this.loadComponent.bind(this)} ></img>
        </div>
    }
}
ReactDOM.render(
    <Search/>,
    document.getElementById('root')
)